package com.example.springbootweb.bean;

import com.example.springbootweb.interfaces.Foo;
import org.springframework.cglib.core.DebuggingClassWriter;
import org.springframework.cglib.proxy.Enhancer;

/**
 * @author: wukangrong
 * @date: 2019/8/19 16:55
 * @description: cglib动态代理测试
 */
public class CglibTest {


    public static void main(String[] args) {
        System.setProperty(DebuggingClassWriter.DEBUG_LOCATION_PROPERTY, "E:\\wukangrong\\MySpace\\springboot-web\\com\\sun\\proxy");
        Foo proxy= (Foo)Enhancer.create(Foos.class, new MyMethodInterceptor());
        System.out.println(proxy.test("123"));
        System.out.println(proxy.test2());
    }
}
